package com.linsir.lin.controller.omp;

import com.linsir.lin.dto.GridDTO;
import com.linsir.lin.dto.OrganizationDTO;
import com.linsir.lin.pojo.Organization;
import com.linsir.lin.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：linsir
 * @date ：Created in 2021/6/30 8:51
 * @description：组织结构
 * @modified By：
 * @version: 1.0.0
 */
@RestController
@RequestMapping("/organ/")
public class OrganizationController {

    @Autowired
    private OrganizationService organizationService;


    /**
     * 组织属性列表
     * @return
     */
    @RequestMapping(value = "grid",method = {RequestMethod.GET,RequestMethod.POST})
    public GridDTO<Organization> grid(){
        return organizationService.grid();
    }

    /**
     * 树型
     * @return
     */
    @RequestMapping(value = "tree",method = {RequestMethod.GET})
    public List<OrganizationDTO> tree()
    {
        return organizationService.organList();
    }
}
